

#import "QuestionCell.h"

@implementation QuestionCell

@synthesize question;
@synthesize name;
@synthesize date;
@synthesize title;
@synthesize photo;
@synthesize voteCount;
@synthesize answerCount;
@synthesize reputation;
@synthesize gbadge;
@synthesize sbadge;
@synthesize bbadge;


-(void)setQuestion:(Question *)newQuestion{
    
        if (newQuestion != question) {
            [question release];
            question = [newQuestion retain];
        }
    title.text = question.questionText;
    name.text = question.author;
    answerCount.text = question.answerCount;
    voteCount.text =  question.votes;
    reputation.text = question.reputation;
    photo.image= question.image;
    date.text = question.date;
    gbadge.text = question.gbadge;
    sbadge.text = question.sbadge;
    bbadge.text = question.bbadge;
}

- (void)dealloc
{
    [reputation release];
    [gbadge release];
    [sbadge release];
    [bbadge release];
    [voteCount release];
    [answerCount release];
    [date release];
    [title release];
    [photo release];
    [name release];
    [super dealloc];
}

- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        // Initialization code
    }
    return self;
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated
{
    [super setSelected:selected animated:animated];
    
    // Configure the view for the selected state
}

@end
